package com.athena.servlet;

import com.athena.pojo.Request;
import com.athena.pojo.Response;

/**
 * @Author: xiaoxiang.zhang
 * @Description:
 * @Date: Create in 11:53 上午 2020/3/26
 */
public abstract class HttpServlet implements Servlet {

  public abstract void doGet(Request request, Response response);

  public abstract void doPost(Request request, Response response);

  @Override
  public void service(Request request, Response response) throws
      Exception {
    if ("GET".equalsIgnoreCase(request.getMethodType())) {
      doGet(request, response);
    } else {
      doPost(request, response);
    }
  }

}
